import Vue from "vue";
import VueRouter, { RouteConfig } from "vue-router";
Vue.use(VueRouter);

//
import Tabs from "@/moduleS/views/tabs/index.vue";
import Home from "@/moduleS/views/tabs/home.vue";
import My from "@/moduleS/views/tabs/my.vue";
//
import Login from "@/module/router/login";
import Bank from "@/module/router/bank";
import Manager from "@/moduleS/router/manager";

const routes: Array<RouteConfig> = [
    {
        path: "/",
        redirect: "/tabs"
    },
    {
        path: "/tabs",
        name: "tabs",
        component: Tabs,
        children: [
            {
                path: "/tabs",
                redirect: "/tabs/home"
            },
            {
                path: "/tabs/home",
                name: "home",
                component: Home
            },
            {
                path: "/tabs/my",
                name: "my",
                component: My
            }
        ]
    },
    ...Manager,
    ...Bank,
    ...Login, // 登录模块
];

const router = new VueRouter({
    mode: "hash",
    base: process.env.BASE_URL,
    routes
});

export default router;
